package com.imooc.girl.handle;

import com.imooc.girl.domain.ReturnResult;
import com.imooc.girl.util.ReturnResultUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionHandle {
    @ExceptionHandler(value=Exception.class)
    @ResponseBody
    public ReturnResult stuInfoHandle(Exception e){
         return ReturnResultUtil.getError(e.getMessage());
    }
}
